import request from '@/utils/request'

// 获取菜单列表 - 不需要传递参数，获取所有数据用于本地过滤
export const getMenuList = (data ={}) => {
    return request({
        url: '/worldSkillMenu/list',
        method: 'post',
        data
    });
};

// 根据父ID获取子菜单列表
export const getMenuListByParentId = (parentId) => {
    return request({
        url: '/worldSkillMenu/getListByParentId',
        method: 'get',
        params: { parentId }
    });
};

// 获取菜单详情
export const getMenuDetail = (id) => {
    return request({
        url: `/worldSkillMenu/getById`,
        method: 'get',
        params: { id }
    });
};

// 新增菜单
export const addMenu = (data) => {
    return request({
        url: '/worldSkillMenu/add',
        method: 'post',
        data
    });
};

// 更新菜单
export const updateMenu = (data) => {
    return request({
        url: '/worldSkillMenu/edit',
        method: 'post',
        data
    });
};

// 删除菜单
export const deleteMenu = (id) => {
    return request({
        url: `/worldSkillMenu/delete`,
        method: 'delete',
        params: { id }
    });
}; 